package com.comtroller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class UserController {

    @RequestMapping(value = "/user/{id}",method = {RequestMethod.GET, RequestMethod.POST})
    public String view(@PathVariable("id") Long id) {
        System.out.println(id + " ~~");
        return id + " ~~";
    }

    @RequestMapping(value = "/user/index",method = {RequestMethod.GET, RequestMethod.POST})
    public String index() {
        return "/index";
    }
    @RequestMapping(value = "/",method = {RequestMethod.GET, RequestMethod.POST})
    public String indexs(@RequestParam(defaultValue = "11111") String id, Model model) {
        model.addAttribute("id",id);
        return "index";
    }
}